package com.example.newspublish.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.newspublish.pojo.entity.Category;
import com.example.newspublish.pojo.form.CategoryForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    int addCategory(CategoryForm categoryForm);

    List<Category> getCategoryList();

    int deleteCategoryById(Long id);

    int updateCategoryById(@Param("id") Long id,@Param("categoryName") String categoryName);

    int isExistCategoryByName(String categoryName);
}
